Public Class ClipboardDemo

    Private Sub btnSetText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetText.Click
        Clipboard.SetText(RichTextBox1.Text)
    End Sub

    Private Sub btnGetText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetText.Click
        If (Clipboard.ContainsText()) Then
            RichTextBox2.Text = Clipboard.GetText()
        Else
            RichTextBox2.Text = "No Text Found"
        End If

    End Sub

    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        Clipboard.Clear()
    End Sub
End Class
